<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<center>
<table border="1">
	<tr align="center"><td colspan="6">Users</td></tr>
	<tr align="center">
		<td> id </td>
		<td> login </td>
		<td> password </td>
		<td> type </td>
		<td> edit </td>
		<td> delete </td>
	</tr>
	<c:if test="${!empty users}"> 
		<c:forEach items="${users}" var="i">
			<tr align="center">
				<td>${i.id}</td>
				<td>${i.login}</td>
				<td>${i.password}</td>
				<td>${i.userType.type}</td>
				<td><a href="<c:url value="edit?user_id=${i.id}" />">Edit</a></td>
				<td><a href="<c:url value="delete?user_id=${i.id}" />">Delete</a></td>
			</tr>
		</c:forEach>
	</c:if>
</table>
<p><a href="<c:url value="add" />">Add</a></p>
</center>
</body>
</html>